﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// 手术开始结束图标
    /// </summary>
    public partial class SSKJCtrl : EventIcon
    {

        #region Variables

        #endregion

        #region Constructor

        public SSKJCtrl()
        {
            InitializeComponent();
        }

        #endregion

        #region Properties

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        private void SSKS()
        {
            Ellipse we = new Ellipse();
            we.Fill = Brushes.Transparent;
            we.Width = this.Width;
            we.Height = this.Width;
            we.Stroke = Brushes.Black;
            we.StrokeThickness = 2;
            _grid.Children.Add(we);
            Ellipse ne = new Ellipse();
            ne.Stroke = Brushes.Black;
            ne.StrokeThickness = 2;
            ne.VerticalAlignment = VerticalAlignment.Center;
            ne.HorizontalAlignment = HorizontalAlignment.Center;
            ne.Width = this.Width / 3;
            ne.Height = this.Width / 3;
            _grid.Children.Add(ne);
        }

        private void SSJS()
        {
            Ellipse el = new Ellipse();
            el.Height = this.Height;
            el.Width = this.Width;
            el.Fill = Brushes.Transparent;
            el.Stroke = Brushes.Black;
            el.StrokeThickness = StrokeThickness;
            _grid.Children.Add(el);
            Line line = new Line()
            {
                X1 = this.Width * 0.25,
                Y1 = this.Height * 0.25,
                X2 = this.Width * 0.75,
                Y2 = this.Height * 0.75,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line);
            Line line1 = new Line()
            {
                X1 = this.Width * 0.75,
                Y1 = this.Height * 0.25,
                X2 = this.Width * 0.25,
                Y2 = this.Height * 0.75,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line1);
        }

        #endregion

        #region Public/Protected Methods

        public override void ResizeIcon()
        {
            if (Identify)
            {
                SSKS();
            }
            else
            {
                SSJS();
            }
        }

        #endregion

        #region EventHandlers

        #endregion
    }
}
